package com.rj.bd.example;

import com.rj.bd.kj.dc.MyAbstractClass;
import com.rj.bd.kj.dc.aes.EncryptionConfig;
import com.rj.bd.kj.dc.aes.SymmetricEncryption;
import com.rj.bd.kj.dc.des.DESDataMaskingService;
import com.rj.bd.kj.zdy.MyAbstractClassZDY;
import com.rj.bd.kj.zdy.SimpleDataMaskerEncryptor;

import java.security.Key;



public class TestExample1 {
    public static void main(String[] args) {



        System.out.println("--------DES加密解密手机号----------");
        String key = "12345678";
        MyAbstractClass DES = new DESDataMaskingService(key);
        String data = "13523328835";
        String result = DES.encrypt(data);
        System.out.println("加密结果：" + result);
        result = DES.decrypt(result);
        System.out.println("解密结果：" + result);


        System.out.println("---------自定义加密解密银行卡----------");
        MyAbstractClassZDY zdy = new SimpleDataMaskerEncryptor();
        data = "130423200802232110";
        //脱敏
        result = zdy.mask(data);
        System.out.println("脱敏结果：" + result);
        //加密
        result = zdy.encrypt(data);
        System.out.println("加密结果：" + result);
        //解密
        result = zdy.decrypt(result);
        System.out.println("解密结果：" + result);








    }
}
